package designpatterns.responsibility.chain.code.approve;

/**
 * 副校长审批
 */
public class VicePrincipal extends ApproveChain{

    @Override
    void doApprove(Approve approve) {
        if (approve.getAmount() > 10000
                && approve.getAmount() <= 30000) {
            process(approve);
        } else {
            super.getNextApprover().doApprove(approve);
        }
    }

    private void process(Approve approve) {
        System.out.println("(副校长)"+super.getName()+"处理审批="+approve);
    }

    public VicePrincipal(String name) {
        super.name = name;
    }

}
